@{
    ViewBag.Title = "通知人管理";
}
@section head{
   <script type="text/javascript">
       $(document).ready(function () {
           $('.btnSearch').click(function () {
               mainSearch('.search_box :input');
           });
       });
       function on_close(key) {
           $('#details').datagrid('reload'); 
       }
       function onDeleteData() {
           $('#details').datagrid('reload');
       }

       function cmdformat(value, row, index) {
           return '<a href="javascript:Del(\'' + row.UserName + '\',onDeleteData,\'@Url.Action("Delete",new {EventCode=ViewBag.EventCode})\')">删除</a>';
       }
       function add() {
           DataDialog.Show('Manager', true, true, undefined, function (ret) {
               postModal('@Url.Action("Add")', { EventCode: '@ViewBag.EventCode', UserName: ret.result }, function (ret) {
                   if (ret.success) {
                       $('#details').datagrid('reload');
                   }
               });
           });
       }
   </script>
}
@section body{
<body>
<div class="easyui-layout" data-options="fit:true">
    <div region="north" border="false">
        <div class="navigation">
            <div class="left">
                @ViewBag.CurrentPath 通知人管理
            </div>
            <a href="javascript:CloseMe();" class="back">后退</a>
        </div>
        <div class="tools_box">
	        <div class="tools_bar">
                <div class="left">
                   <a href="javascript:add();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true ">添加</a>  
                   <a href="javascript:DeleteSelecteds($('#details').datagrid('getSelections'),'UserName',onDeleteData,'@Url.Action("Delete",new {EventCode=ViewBag.EventCode})')" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
                </div>
            </div>
            <div class="search_box">
			   
		    </div>
        </div>
    </div> 
    <div region="center" border="false">
        <table class="easyui-datagrid" id="details" data-options="fit:true,rownumbers:true,singleSelect:false,
          pagination:true,border:true,url:serverUrl.list,queryParams:{EventCode:'@ViewBag.EventCode'}">
           <thead data-options="frozen:true"> 
              <tr>
                   <th data-options="checkbox:true"></th>
                   <th data-options="field:'UserName',sortable:true,width:100">通知人帐号</th>
              </tr>
           </thead>
           <thead>  
               <tr>  
                   <th data-options="field:'RealName',sortable:false,width:120">姓名</th>
                   <th data-options="field:'GroupName',sortable:false,width:120">部门</th>
                   <th data-options="field:'Email',sortable:false,width:200">邮箱</th>
                   <th data-options="field:'cmd',width:100,align:'center',formatter:cmdformat">操作</th>
               </tr>  
           </thead>  
        </table>
    </div>
</div>
</body>
}